﻿package mortal.game.view.closedBetaGiftBagNew
{
    import com.mui.controls.*;
    import com.mui.display.*;
    import mortal.common.display.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;

    public class ClosedBetaOnlineTimeBar extends GSprite
    {
        private var _bg:ScaleBitmap;
        private var _progressBar:BaseProgressBar;
        private var _maxTimeValue:uint;

        public function ClosedBetaOnlineTimeBar()
        {
            return;
        }// end function

        override public function createDisposedChildren() : void
        {
            super.createDisposedChildren();
            this._progressBar = new BaseProgressBar();
            this.addChild(this._progressBar);
            this._progressBar.setProgress(BitmapDataConst.AlphaBMD, true, 0, 0, 842, 30);
            this._progressBar.setTweenProgress(ImagesConst.OnlineTimeBar, true, 0, 0, 842, 30);
            return;
        }// end function

        override public function dispose(param1:Boolean = true) : void
        {
            super.dispose(param1);
            this._progressBar.dispose(param1);
            this._progressBar = null;
            return;
        }// end function

        public function setMaxTimeValue(param1:uint) : void
        {
            this._maxTimeValue = param1;
            return;
        }// end function

        public function setTimeValue(param1:uint) : void
        {
            if (param1 > this._maxTimeValue)
            {
                param1 = this._maxTimeValue;
            }
            this._progressBar.setValue(param1, this._maxTimeValue, true);
            return;
        }// end function

    }
}
